﻿@using BlazorComponent.I18n
@using System.Globalization
@inherits LayoutComponentBase
<ErrorBoundary>
    <ChildContent>
        <MApp>
            <div class="page">
                <div class="sidebar">
                    <NavMenu />
                </div>

                <main>
                    <div class="top-row px-4">
                        <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
                    </div>

                    <article class="content px-4">
                        @Body
                    </article>
                </main>
            </div>
        </MApp>
    </ChildContent>
    <ErrorContent>
        @context.ToString()
    </ErrorContent>
</ErrorBoundary>

@code
{
    [Inject] private I18n I18n { get; set; }
    protected override async Task OnInitializedAsync()
    {
        I18n.SetCulture(new CultureInfo("zh-CN"));
        await base.OnInitializedAsync();
    }
}
